<?php
     //$id=$_GET['id'];
//echo $id;die;
    $dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
    $sql="select * from happy";
    $arr=$dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);
      foreach($arr as $key=>$value)
      {
          ob_start();
          file_put_contents($value['id'].'.html',ob_get_clean());
          include "moban.php";
      }
?>